package com.yueyang.sojourn.server.service.sojourn.share;

import com.yueyang.sojourn.server.model.po.SojournShareDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Andy.yang
 * @version v1
 * @summary
 * @Copyright (c) 2019, YueYang Group All Rights Reserved.
 * @since 2020/3/31
 */
@Mapper
public interface SojournShareDetailMapper {
    /**
     * 创建分账单明细
     * @param detail
     * @return
     */
    int insert(SojournShareDetail detail);

    /**
     * 批量创建分账单明细
     * @param details
     * @return
     */
    int insertBatch(List<SojournShareDetail> details);

    /**
     * 修改状态
     * @param detail
     * @return
     */
    int updateStatus(SojournShareDetail detail);

    /**
     * 查询分账单明细
     * @param id
     * @return
     */
    SojournShareDetail selectByPrimaryKey(Long id);

    /**
     *  查询分账单明细列表
      * @param shareId
     * @return
     */
    List<SojournShareDetail> findBy(@Param("shareId") Long shareId, @Param("status") Integer status);
}
